// sgu316
// 题意：模拟题
// 题解：模拟
//
// run: $exec < input
#include <iostream>

int const maxn = 10;
int hpoint[maxn], score[maxn];
int n, m;

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n >> m;
	for (int i = 1; i <= n; i++) hpoint[i] = 100;
	for (int i = 0; i < m; i++) {
		int shoot, target;
		std::cin >> shoot >> target;
		if (hpoint[shoot] <= 0) continue;
		if (hpoint[target] > 0) score[shoot] += 3;
		hpoint[target] -= 8;
	}
	for (int i = 1; i <= n; i++)
		if (hpoint[i] > 0) score[i] += hpoint[i] / 2;
	for (int i = 1; i <= n; i++)
		std::cout << hpoint[i] << ' ' << score[i] << '\n';
}

